﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using QingzimaScenario;
using QingzimaLogicModel;

namespace QingzimaWebClient.Controllers
{
    public class HoutaiDengluController : Controller
    {
        //
        // GET: /HoutaiDenglu/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Index(HttpPostedFileBase file)
        {
            if (string.IsNullOrEmpty(Request.Form.Get("name")))
            {
                Response.Write("<script language='javascript'>alert('请输入用户名')</script>");
            }
            else
            {
                string zhanghao = Request.Form.Get("name");
                string mima = Request.Form.Get("pass");

                if (zhanghao == "admin" && mima == "admin")
                {
                    return RedirectToAction("../HoutaiShouye");
                }
                else
                {
                    Response.Write("<script language='javascript'>alert('用户名或密码不正确')</script>");
                }
            }
            return View();
        }
    }
}
